package com.yishusmt.mobsmt.utils;

import io.swagger.models.auth.In;

/**
 *  随机生成验证码
 *
 * @author zhangyi
 * @date 2018/8/9 16:32
 */
public class RandCodeUtil {

    public static final Integer LENGHT = 6;

    /**
     * 生成6位随机数
     *
     * @return
     */
    public static String getRandCode(){
        StringBuffer stringBuffer = new StringBuffer();
        for(int i = 0; i < LENGHT ; i++){
            Integer in = (int) Math.floor(Math.random()*9);
            stringBuffer.append(in);
        }
        return stringBuffer.toString();
    }
}
